var local="http://47.104.10.151";
var key_id1;
var key_id2;
var key_id3;
var key_id4;
var key_id5;
var key_id6;
var page1=0;
var totalPages1=0;

function creatxmlHTTPU() {
    if(window.XMLHttpRequest){
//  IE7+, Firefox, Chrome, Opera, Safari 浏览器执行代码
        xmlHttp=new XMLHttpRequest();
    }else {
        // IE6, IE5 浏览器执行代码
        xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
    return xmlHttp;
}
//显示已付款待确认的订单
function seachUser() {
    xmlHttp = creatxmlHTTPU();
    var txt = "";//用于存储拼接字符串；
    var url=local+":8080/login/loginMaster";
    //拼接字符
    txt = "page=" + page1;
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);

    xmlHttp.onreadystatechange = function () {
        if (xmlHttp.readyState == 4 && xmlHttp.status == 200) {
            var result = xmlHttp.responseText;
            var json = eval("(" + result + ")");

            key_id1=json.data.content[0].keyId;

            var input1 = document.getElementsByName("Resume1");
            input1[0].value = json.data.content[0].user_name;
            input1[1].value = json.data.content[0].user_password;
            input1[2].value = json.data.content[0].email;
            input1[3].value = json.data.content[0].user_nick;
            input1[4].value = json.data.content[0].company_code;
            input1[5].value = json.data.content[0].company_name;
            input1[6].value = json.data.content[0].mobile;
            totalPages1=json.data.totalPages;

            var input2 = document.getElementsByName("Resume2");
            key_id2=json.data.content[1].keyId;
            input2[0].value = json.data.content[1].user_name;
            input2[1].value = json.data.content[1].user_password;
            input2[2].value = json.data.content[1].email;
            input2[3].value = json.data.content[1].user_nick;
            input2[4].value = json.data.content[1].company_code;
            input2[5].value = json.data.content[1].company_name;
            input2[6].value = json.data.content[1].mobile;

            var input3 = document.getElementsByName("Resume3");
            key_id3=json.data.content[2].keyId;

            input3[0].value = json.data.content[2].user_name;
            input3[1].value = json.data.content[2].user_password;
            input3[2].value = json.data.content[2].email;
            input3[3].value = json.data.content[2].user_nick;
            input3[4].value = json.data.content[2].company_code;
            input3[5].value = json.data.content[2].company_name;
            input3[6].value = json.data.content[2].mobile;

            var input4 = document.getElementsByName("Resume4");
            key_id4=json.data.content[3].keyId;
            input4[0].value = json.data.content[3].user_name;
            input4[1].value = json.data.content[3].user_password;
            input4[2].value = json.data.content[3].email;
            input4[3].value = json.data.content[3].user_nick;
            input4[4].value = json.data.content[3].company_code;
            input4[5].value = json.data.content[3].company_name;
            input4[6].value = json.data.content[3].mobile;

            var input5 = document.getElementsByName("Resume5");
            key_id5=json.data.content[4].keyId;

            input5[0].value = json.data.content[4].user_name;
            input5[1].value = json.data.content[4].user_password;
            input5[2].value = json.data.content[4].email;
            input5[3].value = json.data.content[4].user_nick;
            input5[4].value = json.data.content[4].company_code;
            input5[5].value = json.data.content[4].company_name;
            input5[6].value = json.data.content[4].mobile;

            var input6 = document.getElementsByName("Resume6");
            key_id6=json.data.content[5].keyId;

            input6[0].value = json.data.content[5].user_name;
            input6[1].value = json.data.content[5].user_password;
            input6[2].value = json.data.content[5].email;
            input6[3].value = json.data.content[5].user_nick;
            input6[4].value = json.data.content[5].company_code;
            input6[5].value = json.data.content[5].company_name;
            input6[6].value = json.data.content[5].mobile;
        }
    }
}
function deletUser1() {
    var xmlHttp = creatxmlHTTPU();
    alert("删除成功，刷新后消除");
    var txt = "";//用于存储拼接字符串；
    var url=local+":8080/login/deleteUser";
    //拼接字符
    txt = "user_Id=" + key_id1;
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}

function deletUser2() {
    var xmlHttp = creatxmlHTTPU();
    alert("删除成功，刷新后消除");
    var txt = "";//用于存储拼接字符串；
    var url=local+":8080/login/deleteUser";
    //拼接字符
    txt = "user_Id=" + key_id2;
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}

function deletUser3() {
    var xmlHttp = creatxmlHTTPU();
    alert("删除成功，刷新后消除");
    var txt = "";//用于存储拼接字符串；
    var url=local+":8080/login/deleteUser";
    //拼接字符
    txt = "user_Id=" + key_id3;
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}

function deletUser4() {
    var xmlHttp = creatxmlHTTPU();
    alert("删除成功，刷新后消除");
    var txt = "";//用于存储拼接字符串；
    var url=local+":8080/login/deleteUser";
    //拼接字符
    txt = "user_Id=" + key_id4;
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}
function deletUser5() {
    var xmlHttp = creatxmlHTTPU();
    alert("删除成功，刷新后消除");
    var txt = "";//用于存储拼接字符串；
    var url=local+":8080/login/deleteUser";
    //拼接字符
    txt = "user_Id=" + key_id5;
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}

function deletUser6() {
    var xmlHttp = creatxmlHTTPU();
    alert("删除成功，刷新后消除");
    var txt = "";//用于存储拼接字符串；
    var url=local+":8080/login/deleteUser";
    //拼接字符
    txt = "user_Id=" + key_id6;
    xmlHttp.open("POST", url, true);
    xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    xmlHttp.send(txt);
}

function addUserPage() {

    if(totalPages1>page1+1){
        for(var i=0;i<document.getElementsByName("Resume1").length;i++){
            document.getElementsByName("Resume1")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Resume2").length;i++){
            document.getElementsByName("Resume2")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Resume3").length;i++){
            document.getElementsByName("Resume3")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Resume4").length;i++){
            document.getElementsByName("Resume4")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Resume5").length;i++){
            document.getElementsByName("Resume5")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Resume6").length;i++){
            document.getElementsByName("Resume6")[i].value="";
        }
        page1++;
        seachUser();
    }
    else alert("已经是最后一页");

}
function decUserPage() {
    if(page1-1>=0){
        for(var i=0;i<document.getElementsByName("Resume1").length;i++){
            document.getElementsByName("Resume1")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Resume1").length;i++){
            document.getElementsByName("Resume1")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Resume1").length;i++){
            document.getElementsByName("Resume1")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Resume1").length;i++){
            document.getElementsByName("Resume1")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Resume1").length;i++){
            document.getElementsByName("Resume1")[i].value="";
        }
        for(var i=0;i<document.getElementsByName("Resume1").length;i++){
            document.getElementsByName("Resume1")[i].value="";
        }
        page1--;
        seachUser();
    }
    else alert("第一页");
}

